package com.ruoyi.zhmk.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.zhmk.domain.request.PersonCarChartRequest;
import com.ruoyi.zhmk.service.IStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: wwy
 * @Date: 2021/6/28 10:22
 */
@Api("首页统计")
@RestController
@RequestMapping("/statistics")
public class StatisticsController {
    @Autowired
    private IStatisticsService statisticsService;
    /**
     * 人员统计
     * @return
     */
    @ApiOperation("人员统计")
    @GetMapping("/personStatistics")
    public AjaxResult personStatistics(){
        return statisticsService.personStatistics();
    }

    /**
     * 车辆统计
     * @return
     */
    @ApiOperation("车辆统计")
    @GetMapping("/carStatistics")
    public AjaxResult carStatistics(){
        return statisticsService.carStatistics();
    }

    /**
     * 人员车辆日统计图
     * @param personCarChartRequest
     * @return
     */
    @ApiOperation("人员车辆日统计图")
    @PostMapping("/personCarChart")
    public AjaxResult personCarChart(@RequestBody PersonCarChartRequest personCarChartRequest){
        return statisticsService.personCarChart(personCarChartRequest);
    }
}
